package creational.prototype.deepclone1;

import lombok.Data;

/**
 * @Description: 消息抽象
 * @Author: lxt
 * @CreateDate: 2019/11/1
 **/
@Data
public abstract class AbstractMessage implements Cloneable {
    private String from;
    private String to;
    private Content content;

    public abstract void send();

    public Object clone() {
        Object clone = null;
        try {
            this.setContent((Content) this.getContent().clone());
            clone = (AbstractMessage) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return clone;
    }
}
